Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start moving bulk amounts of init_ardupilot to base class #13299

Merged
merged 17 commits into from
Jan 28, 2020

Conversation

peterbarker
Copy link
Contributor

A rather large amount of code can be moved from the init_ardupilot into the base-class setup library.

I've restricted the movement in this PR to just a few functions as they're relatively straight-forward.

Obtaining our list of scheduled tasks might be improved in a future PR; perhaps something along the same lines as how we do the logging structures might work.

@andyp1per
Copy link
Collaborator

@peterbarker I had to add some more generic vehicle stuff for my FFT PR:
84a6f26
48e551d
7c878f1
Feel free to cherry-pick if it would help

@peterbarker
Copy link
Contributor Author

peterbarker commented Jan 16, 2020 via email

@peterbarker
Copy link
Contributor Author

peterbarker commented Jan 16, 2020 via email

@andyp1per
Copy link
Collaborator

andyp1per commented Jan 16, 2020

@peterbarker the FFT stuff has to initialize late as it needs the IMUs to be initialized and started. I guess if the IMU initialization moves here then that would help as I could insert the FFT stuff after.

The boardconfig init is really early, its going to cause problems for a while I think

@peterbarker
Copy link
Contributor Author

@andyp1per https://github.com/ArduPilot/ardupilot/pull/13299/files#diff-021e65608195c65fc50f136f63dad9cdR96 <- that's really, really late :-)

I honestly don't know if we have to run the scheduler initialisation as late as we do. My guess is, "no" - but I put it there to preserve behaviour. IOW, we could even move stuff to after the scheduler init if you want it later still :-)

@andyp1per
Copy link
Collaborator

@peterbarker having the scheduler start late is a good thing I think. I've had to write too much defensive code for coping with the scheduler started but my init() method not being called!

@peterbarker
Copy link
Contributor Author

peterbarker commented Jan 16, 2020 via email

@tridge
Copy link
Contributor

tridge commented Jan 21, 2020

what does this do to firmware size for Pixhawk1-1M ?

@rmackay9
Copy link
Contributor

In general I think this is a great thing to do.

@peterbarker
Copy link
Contributor Author

what does this do to firmware size for Pixhawk1-1M ?

pr/factor-initialisation-up:
  bin/arduplane  1012152  1180  195632  1208964

master:
  bin/arduplane  1012084  1188  195628  1208900

~70 bytes larger

@peterbarker
Copy link
Contributor Author

Parameters, mission and fence are preserved across the move from master to this branch. This validates the StorageManager changes.

@peterbarker
Copy link
Contributor Author

I flew this on my 250.

Copy link
Contributor

@khancyr khancyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The change on copter parameters table where already well tested on #10391

@khancyr
Copy link
Contributor

khancyr commented Jan 23, 2020

Close #10391

@tridge tridge merged commit bde9759 into ArduPilot:master Jan 28, 2020
@peterbarker peterbarker deleted the pr/factor-initialisation-up branch January 28, 2020 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants